1. Technical Field
This invention relates in general to computer graphics display systems which include graphics display means having a frame buffer for storing individual pixels for each of plurality of lines to be displayed on a display monitor. More particularly, the invention comprises an improved method and processor for drawing in the frame buffer `polygon with edge`-type primitives encountered in certain high level graphics interface programs.
2. Description of the Prior Art
`Polygon with data`-type primitives are encountered in graphics interfaces such as GRAPHIGS, marketed by IBM, and PHIGS PLUS created by ISO and described in: "Information Processing Systems--Computer Graphics--Programmer Hierarchal Interactive Graphics System (PHIGS), Part IV--Plus Lumiere and Surfaces (PHIGS PLUS)" ISO Document No. SC24N224, Rev. #3 (July, 1989). A `polygon with edge`-type primitive is defined herein as a `polygon with data`-type primitive with a boundary edge that can be of different color than that of its interior. In addition, the edge may be stylized (i.e., dotted, dashed, etc.) and the polygon can be shaded, lighting applying to interior points only. Further, depth-cueing can be specified and line and hidden surface removal is allowed. Existing techniques for processing `polygons with edge`-type primitives are relatively complex in implementation and time consuming in operation. For example, one approach is to interpolate all edges of the polygon and then interpolate individual lines of the polygon.
In drawing graphics primitives, it is often advantageous from a cost-performance viewpoint to rely on a set of hardwired, basic primitives wherein all other primitives can be decomposed into elements of such a basic primitive set. An example of a basic set is one consisting of only vectors and triangles. With `polygon with edge`-type primitives, applicant has recognized that edges can be advantageously handled by a vector generator and interior points by a triangle generator (i.e., once the polygon has been tessellated into triangles).
An initial difficulty encountered with this approach, however, is that interior points of one triangle may obscure edge points of the polygon. For example, in FIG. 1, the polygon defined by vertices 1,2,3,4 has been tessellated into triangles 1,2,3 and 1,3,4. Note that points Pa,Pb belong to edge 2,3 of triangle 1,2,3 but they are interior points of triangle 1,3,4 as well. If triangle 1,2,3 is processed first and if the orientation of the quadrilateral 1,2,3,4 is such that the interior points (Pa and Pb of triangle 1,3,4) are closer to the viewer than the edge points (Pa and Pb of triangle 1,2,3) then the interior points will obscure the edge points which results in edge discontinuity, an annoying visual effect.
In addition, it is often desirable to emphasize a certain region of a displayed object by highlighting a superimposed polygonal line (perhaps styled) outlining it. Such a line may span several polygons and each segment of the line must correspond to an edge and be coincident with it. In other words, the line and the edge must have the same X,Y, and Z values so that the conventional Z-buffer algorithm will make a point of the line visible if its corresponding point on the edge is also visible. This condition is not guaranteed if some interior points of a polygon obscure edge points of the same polygon because the points may receive a different Z value.
Thus, the present invention solves the above noted problems and provides a shading technique for `polygon with edge`-type primitives which advantageously uses many hardware elements standard in typical graphics display systems.